use std::str::FromStr;

use serde::{Deserialize, Serialize};

#[derive(Serialize, Debug, Deserialize)]
pub enum RarityFormula {
    MagicEden,
    CoralCube,
    All,
}

impl FromStr for RarityFormula {
    type Err = ();

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
            "magiceden" => Self::MagicEden,
            "coralcube" => Self::CoralCube,
            "all" => Self::All,
            _ => Self::All,
        })
    }
}
